# ~*~ coding: utf-8 ~*~
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import InputRequired

from apps.common.form import ErrorFormMinx

__all__ = ['LabelForm']


class LabelForm(ErrorFormMinx, FlaskForm):
    name = StringField(validators=[InputRequired('标签名称不能为空')])

    class Meta:
        csrf = True

    @property
    def data(self):
        return {
            'name': self.name.data,
        }
